﻿Imports DevExpress.XtraTabbedMdi

Public Class RibbonFormMain

    Private Sub GestionarPanel()
        If XTabManager.Pages.Count = 0 Then
            ClientPanel.Visible = True
        Else
            ClientPanel.Visible = False
        End If
    End Sub

    Private Sub XTabManager_Pages(ByVal sender As Object, ByVal e As MdiTabPageEventArgs) Handles XTabManager.PageAdded, XTabManager.PageRemoved
        GestionarPanel()
    End Sub

    Private Sub BarButtonItem1_ItemClick(ByVal sender As Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
        With frmGestionesOficina
            .MdiParent = Me
            '.StartPosition = FormStartPosition.CenterScreen
            .Show()
            .Focus()
        End With
    End Sub

    Private Sub RibbonFormMain_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
        lblConectadoComo.Caption = String.Format("{0} ({1})", SesionActiva.Nombre, SesionActiva.Usuario)
        lblUbicacion.Caption = String.Format("{0}, {1}", SesionActiva.Sucursal, SesionActiva.Oficina)
    End Sub

    Private Sub BarButtonItem3_ItemClick(ByVal sender As Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem3.ItemClick
        frmLogin.Show()
        Close()
    End Sub

    Private Sub BarButtonItem4_ItemClick(ByVal sender As Object, ByVal e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem4.ItemClick
        Application.Exit()
    End Sub
End Class